package com.sam;

import com.sam.schedule.ScheduleServiceImpl;
import com.sam.util.TestUtil;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class AppStart {
    public static void main(String[] args) throws Exception {
        ConfigurableApplicationContext app = new SpringApplicationBuilder(AppStart.class).web(true).run(args);
/*        TestUtil test = app.getBean(TestUtil.class);
        test.threadPoolObserver();

        Thread.sleep(5000);

        ThreadPoolUtil threadPoolUtil = app.getBean(ThreadPoolUtil.class);
        threadPoolUtil.shutdownNow();

        Thread.sleep(5000);

        ScheduleServiceImpl scheduleServiceImpl = app.getBean(ScheduleServiceImpl.class);
        //scheduleServiceImpl.stopJob();
        Thread.sleep(5000);
        scheduleServiceImpl.stopJob();
        Thread.sleep(2000);
        scheduleServiceImpl.reStartJob();

        Thread.sleep(5000);
        scheduleServiceImpl.stopJob();
        Thread.sleep(2000);
        scheduleServiceImpl.reStartJob();

        Thread.sleep(5000);
        scheduleServiceImpl.stopJob();
        Thread.sleep(2000);
        scheduleServiceImpl.reStartJob();

        Thread.sleep(5000);
        scheduleServiceImpl.stopJob();
        Thread.sleep(2000);
        scheduleServiceImpl.reStartJob();*/



    }
}
